*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0f172a;
  --surface: #1e293b;
  --surface2: #162032;
  --border: #334155;
  --text: #f1f5f9;
  --text-muted: #64748b;
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --green: #22c55e;
  --red: #ef4444;
  --amber: #f59e0b;
  --radius: 12px;
  --sidebar-w: 200px;
}

html, body { height: 100%; background: var(--bg); color: var(--text); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; font-size: 14px; }

.app-shell { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar { width: var(--sidebar-w); background: var(--surface2); border-right: 1px solid var(--border); padding: 20px 12px; display: flex; flex-direction: column; gap: 4px; flex-shrink: 0; }
.sidebar-brand { font-size: 16px; font-weight: 800; color: var(--primary); padding: 8px; margin-bottom: 12px; }
.nav-link { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 8px; color: var(--text-muted); text-decoration: none; font-weight: 500; transition: all 0.15s; }
.nav-link:hover { background: var(--surface); color: var(--text); }
.nav-link.active { background: var(--primary); color: white; }

/* Main */
.main-content { flex: 1; padding: 32px; overflow-y: auto; max-width: 860px; }
.page-header { display: flex; align-items: center; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }
.page-header h1 { font-size: 22px; font-weight: 700; flex: 1; }
.back-link { color: var(--text-muted); text-decoration: none; font-size: 13px; }
.back-link:hover { color: var(--text); }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; border: none; text-decoration: none; transition: all 0.15s; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-ghost { background: var(--surface); color: var(--text-muted); border: 1px solid var(--border); }
.btn-ghost:hover { color: var(--text); }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }

/* Inputs */
.input { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; color: var(--text); padding: 8px 12px; font-size: 14px; outline: none; }
.input:focus { border-color: var(--primary); }
.input-sm { width: 80px; }

/* Children grid */
.child-grid { display: flex; flex-direction: column; gap: 10px; }
.child-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; display: flex; align-items: center; gap: 14px; }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: white; font-weight: 700; font-size: 16px; flex-shrink: 0; }
.avatar-sm { width: 28px; height: 28px; font-size: 12px; }
.child-info { flex: 1; }
.child-name { font-weight: 700; font-size: 15px; }
.child-meta { color: var(--text-muted); font-size: 12px; margin-top: 2px; }
.child-actions { display: flex; gap: 8px; }

/* Sessions */
.session-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; }
.session-header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.session-date { color: var(--text-muted); font-size: 13px; }
.session-stats { color: var(--text-muted); font-size: 12px; margin-left: auto; }
.badge { padding: 3px 8px; border-radius: 100px; font-size: 11px; font-weight: 600; text-transform: uppercase; }
.badge-active { background: rgba(99,102,241,0.2); color: var(--primary); }
.badge-complete { background: rgba(34,197,94,0.2); color: var(--green); }

/* Food thumbs */
.food-thumbs { display: flex; flex-wrap: wrap; gap: 8px; }
.food-thumb { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 64px; }
.food-thumb img { width: 64px; height: 64px; border-radius: 8px; object-fit: cover; }
.food-thumb span { font-size: 10px; color: var(--text-muted); text-align: center; line-height: 1.2; }

/* History */
.history-list { display: flex; flex-direction: column; gap: 8px; }
.history-row { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; display: flex; align-items: center; gap: 12px; }
.history-info { flex: 1; display: flex; flex-direction: column; }
.history-name { font-weight: 600; font-size: 14px; }
.history-date { color: var(--text-muted); font-size: 12px; }
.history-likes { color: var(--text-muted); font-size: 13px; }

/* Form */
.form-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; max-width: 480px; display: flex; flex-direction: column; gap: 20px; }
.form-group { display: flex; flex-direction: column; gap: 8px; }
.form-label { font-weight: 600; font-size: 13px; color: var(--text); }
.form-hint { color: var(--text-muted); font-size: 12px; margin-top: 4px; }
.radio-option { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; }
.radio-option:hover { border-color: var(--primary); }
.radio-option input { accent-color: var(--primary); }

/* Handoff card */
.session-handoff-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; max-width: 440px; text-align: center; }
.handoff-title { color: var(--text-muted); font-size: 14px; margin-bottom: 12px; }
.handoff-url { color: var(--primary); font-size: 15px; font-weight: 600; margin-bottom: 16px; }
.handoff-label { color: var(--text-muted); font-size: 13px; margin-bottom: 8px; }
.session-code { font-size: 48px; font-weight: 900; letter-spacing: 8px; color: var(--text); margin-bottom: 12px; }
.handoff-goal { color: var(--text-muted); font-size: 14px; }

/* Empty state */
.empty-state { color: var(--text-muted); padding: 40px; text-align: center; font-size: 15px; }
.empty-state a { color: var(--primary); }

@media (max-width: 600px) {
  .sidebar { display: none; }
  .main-content { padding: 16px; }
}
