@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@500;600;700&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --blue: #00B5E2;        /* Pantone 306 C */
  --blue-dim: #0090b5;
  --blue-glow: rgba(0,181,226,0.18);
  --blue-glow-strong: rgba(0,181,226,0.35);

  --bg:       #0D1117;
  --bg2:      #161B22;
  --bg3:      #1C2330;
  --bg4:      #222B38;
  --border:   #2A3441;
  --border2:  #334155;

  --text:     #E6EDF3;
  --text2:    #8B949E;
  --text3:    #6E7681;

  --green:    #3FB950;
  --green-dim:#1a4d24;
  --yellow:   #D29922;
  --yellow-dim:#3d2e00;
  --red:      #F85149;
  --red-dim:  #4d1f1e;
  --orange:   #E3943A;
  --purple:   #A371F7;

  --morning:   #1a2a1a;
  --morning-b: #3FB950;
  --midday:    #2a2010;
  --midday-b:  #D29922;
  --afternoon: #0d1f2a;
  --afternoon-b: #00B5E2;
  --evening:   #1e1a2a;
  --evening-b: #A371F7;

  --radius:   12px;
  --radius-lg:18px;
  --shadow:   0 4px 24px rgba(0,0,0,0.4);
  --shadow-blue: 0 0 24px rgba(0,181,226,0.2);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ---- SCROLLBAR ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }

/* ---- APP SHELL ---- */
#app-shell { display: flex; flex-direction: column; min-height: 100vh; }

/* ---- TOP HEADER ---- */
.app-header {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.app-header-left { display: flex; align-items: center; gap: 12px; }
.app-logo {
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--blue);
  letter-spacing: 0.5px;
  text-decoration: none;
  white-space: nowrap;
}
.app-logo span { color: var(--text2); font-weight: 500; }
.user-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 4px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text2);
}
.user-chip .dot {
  width: 8px; height: 8px; border-radius: 50%;
}
.user-chip.caden .dot { background: var(--blue); }
.user-chip.colten .dot { background: var(--green); }
.user-chip.parent .dot { background: var(--yellow); }

.logout-btn {
  background: none; border: 1px solid var(--border);
  border-radius: 8px; padding: 5px 10px;
  color: var(--text2); font-size: 0.8rem; font-weight: 600;
  cursor: pointer; transition: all 0.2s;
  font-family: 'Inter', sans-serif;
}
.logout-btn:hover { border-color: var(--red); color: var(--red); }

/* ---- BOTTOM NAV ---- */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--bg2);
  border-top: 1px solid var(--border);
  display: flex;
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom);
}
.nav-btn {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 3px; padding: 10px 4px;
  background: none; border: none; cursor: pointer;
  color: var(--text3); transition: all 0.2s;
  font-family: 'Inter', sans-serif;
}
.nav-btn .nav-icon { font-size: 1.4rem; line-height: 1; }
.nav-btn .nav-label { font-size: 0.65rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.nav-btn.active { color: var(--blue); }
.nav-btn.active .nav-icon { filter: drop-shadow(0 0 6px var(--blue)); }

/* ---- PAGE CONTENT ---- */
.page-content {
  flex: 1;
  padding: 16px 14px 90px;
  max-width: 600px;
  margin: 0 auto;
  width: 100%;
}

/* ---- SECTION HEADER ---- */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.section-title {
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.1rem; font-weight: 700;
  color: var(--text); letter-spacing: 0.3px;
  display: flex; align-items: center; gap: 8px;
}
.section-title::before {
  content: '';
  display: inline-block;
  width: 3px; height: 16px;
  background: var(--blue);
  border-radius: 2px;
}

/* ---- CARDS ---- */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 12px;
}
.card.glow { box-shadow: var(--shadow-blue); border-color: rgba(0,181,226,0.3); }
.card-label {
  font-size: 0.72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.8px;
  color: var(--text3); margin-bottom: 8px;
}

/* ---- HERO STAT ---- */
.hero-stat {
  background: linear-gradient(135deg, var(--bg3) 0%, var(--bg2) 100%);
  border: 1px solid rgba(0,181,226,0.25);
  border-radius: var(--radius-lg);
  padding: 20px 18px;
  margin-bottom: 12px;
  position: relative;
  overflow: hidden;
}
.hero-stat::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 120px; height: 120px;
  background: var(--blue-glow);
  border-radius: 50%;
  filter: blur(30px);
}
.hero-stat-label { font-size: 0.75rem; font-weight: 600; color: var(--blue); text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 4px; }
.hero-stat-value { font-family: 'Rajdhani', sans-serif; font-size: 2.8rem; font-weight: 700; color: var(--text); line-height: 1; }
.hero-stat-sub { font-size: 0.82rem; color: var(--text2); margin-top: 4px; }

/* ---- STAT ROW ---- */
.stat-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.stat-box {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 10px; text-align: center;
}
.stat-box-val { font-family: 'Rajdhani', sans-serif; font-size: 1.4rem; font-weight: 700; color: var(--blue); }
.stat-box-label { font-size: 0.7rem; color: var(--text3); font-weight: 600; margin-top: 2px; }

/* ---- FORMS ---- */
.form-group { display: flex; flex-direction: column; gap: 8px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }

label.field-label {
  font-size: 0.72rem; font-weight: 700;
  color: var(--text3); text-transform: uppercase; letter-spacing: 0.6px;
  display: block; margin-bottom: 3px;
}

input, select, textarea {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  width: 100%;
  transition: border-color 0.2s, box-shadow 0.2s;
  appearance: none;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-glow);
}
input::placeholder, textarea::placeholder { color: var(--text3); }
textarea { resize: vertical; min-height: 70px; }
select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238B949E' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px; padding: 10px 18px;
  border: none; border-radius: var(--radius);
  font-family: 'Inter', sans-serif; font-size: 0.88rem; font-weight: 600;
  cursor: pointer; transition: all 0.2s; white-space: nowrap;
}
.btn-full { width: 100%; }
.btn-primary { background: var(--blue); color: #000; }
.btn-primary:hover { background: #00ccff; box-shadow: 0 0 16px var(--blue-glow-strong); }
.btn-secondary { background: var(--bg3); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--blue); color: var(--blue); }
.btn-success { background: var(--green-dim); color: var(--green); border: 1px solid var(--green-dim); }
.btn-success:hover { background: var(--green); color: #000; }
.btn-danger { background: var(--red-dim); color: var(--red); border: 1px solid var(--red-dim); }
.btn-danger:hover { background: var(--red); color: #fff; }
.btn-warning { background: var(--yellow-dim); color: var(--yellow); border: 1px solid var(--yellow-dim); }
.btn-warning:hover { background: var(--yellow); color: #000; }
.btn-sm { padding: 5px 10px; font-size: 0.78rem; border-radius: 8px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ---- BADGES ---- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 50px;
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px;
}
.badge-pending  { background: var(--yellow-dim); color: var(--yellow); }
.badge-approved { background: var(--green-dim);  color: var(--green);  }
.badge-rejected { background: var(--red-dim);    color: var(--red);    }
.badge-blue     { background: var(--blue-glow);  color: var(--blue);   }
.badge-blocked  { background: #2a1a00; color: var(--orange); }

/* ---- ENTRY ROW ---- */
.entry-row {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 12px 0; border-bottom: 1px solid var(--border); gap: 10px;
}
.entry-row:last-child { border-bottom: none; padding-bottom: 0; }
.entry-info { flex: 1; min-width: 0; }
.entry-date { font-size: 0.7rem; color: var(--text3); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 2px; }
.entry-title { font-weight: 600; font-size: 0.92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.entry-sub { font-size: 0.8rem; color: var(--text2); margin-top: 2px; }
.entry-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.entry-pay { font-family: 'Rajdhani', sans-serif; font-size: 1.1rem; font-weight: 700; color: var(--green); }
.entry-pay.pending-pay { color: var(--yellow); }

/* ---- CHORE ITEM ---- */
.chore-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 0; border-bottom: 1px solid var(--border);
}
.chore-item:last-child { border-bottom: none; }
.chore-check {
  width: 22px; height: 22px; border-radius: 6px;
  border: 2px solid var(--border2); background: var(--bg3);
  flex-shrink: 0; cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.chore-check.checked { background: var(--green); border-color: var(--green); color: #000; font-size: 0.75rem; }
.chore-check.pending-verify { background: var(--yellow-dim); border-color: var(--yellow); color: var(--yellow); font-size: 0.75rem; }
.chore-label { flex: 1; font-size: 0.9rem; font-weight: 500; }
.chore-label.done { text-decoration: line-through; color: var(--text3); }

/* ---- SCHEDULE BLOCKS ---- */
.schedule-block {
  display: flex; gap: 12px; padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.schedule-block:last-child { border-bottom: none; }
.schedule-time {
  font-size: 0.75rem; font-weight: 700; color: var(--text3);
  width: 62px; flex-shrink: 0; padding-top: 2px; text-align: right;
}
.schedule-pill {
  flex: 1; padding: 8px 12px; border-radius: 10px;
  font-size: 0.875rem; font-weight: 600; border-left: 3px solid;
}
.schedule-pill.morning   { background: var(--morning);   border-color: var(--morning-b);   color: #a8e6a8; }
.schedule-pill.midday    { background: var(--midday);    border-color: var(--midday-b);    color: #f0d080; }
.schedule-pill.afternoon { background: var(--afternoon); border-color: var(--afternoon-b); color: #80d4f0; }
.schedule-pill.evening   { background: var(--evening);   border-color: var(--evening-b);   color: #c4a8f0; }
.schedule-pill .pill-drive { font-size: 0.68rem; color: var(--blue); font-weight: 700; margin-top: 2px; }
.schedule-pill .pill-block { font-size: 0.68rem; color: var(--red); font-weight: 700; margin-top: 2px; }

/* ---- MILESTONE BADGE ---- */
.milestone-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.milestone-item {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px 12px;
  display: flex; align-items: center; gap: 10px;
  transition: all 0.2s;
}
.milestone-item.earned {
  border-color: rgba(0,181,226,0.4);
  background: linear-gradient(135deg, var(--bg3), rgba(0,181,226,0.06));
}
.milestone-emoji { font-size: 1.5rem; flex-shrink: 0; }
.milestone-item:not(.earned) .milestone-emoji { filter: grayscale(1); opacity: 0.3; }
.milestone-label { font-size: 0.8rem; font-weight: 600; color: var(--text2); }
.milestone-item.earned .milestone-label { color: var(--text); }

/* ---- STREAK ---- */
.streak-bar {
  display: flex; gap: 6px; margin-top: 8px;
}
.streak-dot {
  flex: 1; height: 6px; border-radius: 3px;
  background: var(--border);
  transition: background 0.3s;
}
.streak-dot.active { background: var(--blue); box-shadow: 0 0 6px var(--blue-glow-strong); }

/* ---- TABS ---- */
.tab-bar {
  display: flex; gap: 4px;
  background: var(--bg3); border-radius: var(--radius);
  padding: 4px; margin-bottom: 14px;
}
.tab-btn {
  flex: 1; padding: 8px 10px; border: none; border-radius: 8px;
  background: transparent; color: var(--text2);
  font-family: 'Inter', sans-serif; font-size: 0.82rem; font-weight: 600;
  cursor: pointer; transition: all 0.2s;
}
.tab-btn.active { background: var(--bg); color: var(--blue); box-shadow: 0 1px 4px rgba(0,0,0,0.3); }

/* ---- TOAST ---- */
#toast {
  position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px 18px;
  font-size: 0.88rem; font-weight: 600;
  box-shadow: var(--shadow); z-index: 999;
  opacity: 0; transition: all 0.3s; pointer-events: none;
  white-space: nowrap;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.success { border-color: var(--green); color: var(--green); }
#toast.error   { border-color: var(--red);   color: var(--red);   }
#toast.info    { border-color: var(--blue);  color: var(--blue);  }

/* ---- DIVIDER ---- */
.divider { height: 1px; background: var(--border); margin: 14px 0; }

/* ---- EMPTY STATE ---- */
.empty-state { text-align: center; padding: 32px 16px; color: var(--text3); }
.empty-state .empty-icon { font-size: 2.2rem; margin-bottom: 8px; opacity: 0.5; }
.empty-state p { font-size: 0.88rem; font-weight: 600; }

/* ---- ALERT ---- */
.alert {
  padding: 10px 14px; border-radius: var(--radius);
  font-size: 0.85rem; font-weight: 600; margin-bottom: 12px;
  display: flex; align-items: flex-start; gap: 8px;
}
.alert-warning { background: var(--yellow-dim); color: var(--yellow); border: 1px solid rgba(210,153,34,0.3); }
.alert-info    { background: var(--blue-glow);  color: var(--blue);   border: 1px solid rgba(0,181,226,0.3); }
.alert-success { background: var(--green-dim);  color: var(--green);  border: 1px solid rgba(63,185,80,0.3); }
.alert-error   { background: var(--red-dim);    color: var(--red);    border: 1px solid rgba(248,81,73,0.3); }

/* ---- TOGGLE ---- */
.toggle-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; }
.toggle-label { font-size: 0.88rem; font-weight: 500; }
.toggle {
  width: 40px; height: 22px; border-radius: 11px;
  background: var(--border2); cursor: pointer; position: relative;
  transition: background 0.2s; border: none; flex-shrink: 0;
}
.toggle.on { background: var(--blue); }
.toggle::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 16px; height: 16px; border-radius: 50%;
  background: white; transition: left 0.2s;
}
.toggle.on::after { left: 21px; }

/* ---- LOGIN SCREEN ---- */
#login-screen {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  min-height: 100vh; padding: 24px;
  background: var(--bg);
}
.login-box {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 24px; padding: 32px 28px;
  width: 100%; max-width: 340px; text-align: center;
  box-shadow: var(--shadow);
}
.login-logo {
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.5rem; font-weight: 700;
  color: var(--blue); margin-bottom: 4px;
}
.login-sub { font-size: 0.85rem; color: var(--text3); margin-bottom: 28px; font-weight: 500; }
.pin-dots { display: flex; justify-content: center; gap: 14px; margin-bottom: 24px; }
.pin-dot {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--border2); background: transparent;
  transition: all 0.15s;
}
.pin-dot.filled { background: var(--blue); border-color: var(--blue); box-shadow: 0 0 8px var(--blue-glow-strong); }
.pin-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 240px; margin: 0 auto; }
.pin-key {
  aspect-ratio: 1; border: 1px solid var(--border);
  border-radius: 14px; background: var(--bg3);
  font-family: 'Rajdhani', sans-serif; font-size: 1.5rem; font-weight: 600;
  color: var(--text); cursor: pointer; transition: all 0.15s;
  display: flex; align-items: center; justify-content: center;
}
.pin-key:hover { background: var(--bg4); border-color: var(--blue); color: var(--blue); }
.pin-key:active { transform: scale(0.92); }
.pin-key.del { font-size: 1rem; color: var(--text2); }
.pin-key.zero { grid-column: 2; }
.pin-error { color: var(--red); font-size: 0.82rem; font-weight: 600; min-height: 18px; margin-top: 14px; }

/* ---- PENDING BADGE ---- */
.pending-count {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--red); color: white;
  width: 16px; height: 16px; border-radius: 50%;
  font-size: 0.65rem; font-weight: 700;
  position: absolute; top: 4px; right: 4px;
}
.nav-btn { position: relative; }

/* ---- ACTIVITY GRID ---- */
.activity-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.activity-tile {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 10px;
  text-align: center; cursor: pointer; transition: all 0.2s;
  position: relative;
}
.activity-tile:hover { border-color: var(--blue); background: rgba(0,181,226,0.05); }
.activity-tile.done { opacity: 0.4; }
.activity-tile.done::after { content: '✓'; position: absolute; top: 6px; right: 8px; font-size: 0.9rem; color: var(--green); font-weight: 700; }
.activity-tile.locked { opacity: 0.25; cursor: not-allowed; }
.activity-tile.locked::after { content: '🚗'; position: absolute; top: 6px; right: 8px; font-size: 0.75rem; }
.tile-emoji { font-size: 1.7rem; margin-bottom: 4px; }
.tile-label { font-size: 0.8rem; font-weight: 600; color: var(--text2); line-height: 1.2; }
.tile-tag { font-size: 0.65rem; font-weight: 700; padding: 2px 6px; border-radius: 50px; margin-top: 4px; display: inline-block; }
.tag-outdoor   { background: rgba(0,181,226,0.15); color: var(--blue); }
.tag-creative  { background: rgba(163,113,247,0.15); color: var(--purple); }
.tag-science   { background: rgba(63,185,80,0.15); color: var(--green); }
.tag-screen    { background: rgba(139,148,158,0.15); color: var(--text2); }
.tag-social    { background: rgba(227,148,58,0.15); color: var(--orange); }

/* ---- RESPONSIVE ---- */
@media (min-width: 600px) {
  .page-content { padding: 20px 20px 90px; }
  .stat-row { grid-template-columns: repeat(3, 1fr); }
}
