*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
:root {
  --bg: #0f0a1a;
  --surface: rgba(255,255,255,.06);
  --surface-hover: rgba(255,255,255,.1);
  --border: rgba(255,255,255,.08);
  --text: #e8e4f0;
  --muted: #9890a8;
  --accent: #7c5cfc;
  --accent2: #3b82f6;
  --red: #ef4444;
  --green: #22c55e;
  --radius: 14px;
  --nav-h: 64px;
}
html, body { height: 100%; }
body {
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  padding-bottom: var(--nav-h);
}
a { color: var(--accent); text-decoration: none; }

/* App Shell */
.app-shell { max-width: 480px; margin: 0 auto; padding: 12px; }

/* Header */
.app-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0 16px; position: sticky; top: 0; z-index: 10;
  background: var(--bg);
}
.app-header h1 {
  font-size: 20px; font-weight: 700;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.app-header .user { font-size: 12px; color: var(--muted); }

/* Card */
.card {
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  transition: all .2s;
}
.card-title {
  font-size: 14px; font-weight: 600; margin-bottom: 12px;
  display: flex; align-items: center; gap: 6px;
}

/* Bottom Nav */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  background: rgba(15,10,26,.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  display: flex; justify-content: space-around; align-items: center;
  height: var(--nav-h); padding-bottom: env(safe-area-inset-bottom, 0);
}
.bottom-nav a {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 10px; color: var(--muted); text-decoration: none;
  padding: 6px 12px; border-radius: 8px; transition: all .2s;
}
.bottom-nav a .icon { font-size: 22px; line-height: 1; }
.bottom-nav a.active { color: var(--accent); }
.bottom-nav a.active .icon { background: linear-gradient(135deg, var(--accent), var(--accent2)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

/* Inputs */
input, textarea, select {
  width: 100%; padding: 12px 14px; border: 1px solid var(--border);
  border-radius: 12px; background: rgba(0,0,0,.3); color: var(--text);
  font: inherit; font-size: 16px; outline: none; transition: border .2s;
}
input:focus, textarea:focus { border-color: var(--accent); }
textarea { resize: vertical; min-height: 80px; }
label { display: block; margin-bottom: 4px; color: var(--muted); font-size: 12px; }
.form-group { margin-bottom: 12px; }
.form-row { display: flex; gap: 8px; align-items: end; }
.form-row > * { flex: 1; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 12px 20px; border: none; border-radius: 12px;
  font-size: 15px; font-weight: 500; cursor: pointer;
  transition: all .2s; -webkit-tap-highlight-color: transparent;
  background: var(--accent); color: #fff; min-height: 44px;
}
.btn:active { transform: scale(.97); }
.btn-sm { padding: 8px 14px; font-size: 13px; min-height: 36px; border-radius: 10px; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-icon { width: 44px; height: 44px; padding: 0; border-radius: 12px; justify-content: center; }
.btn-red { background: var(--red); }
.btn-green { background: var(--green); }

/* Item list */
.item-list { list-style: none; }
.item-list li {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 0; min-height: 48px;
  border-bottom: 1px solid var(--border);
  animation: fadeIn .25s ease;
}
.item-list li:last-child { border: none; }
.item-list .done { text-decoration: line-through; opacity: .4; }
.item-check { width: 22px; height: 22px; accent-color: var(--accent); flex-shrink: 0; }
.item-del {
  margin-left: auto; background: none; border: none;
  color: var(--red); cursor: pointer; font-size: 20px; opacity: .4;
  transition: opacity .2s; padding: 4px;
}
.item-del:active { opacity: 1; }

/* Badge */
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 6px;
  font-size: 10px; font-weight: 600;
}
.badge-private { background: var(--accent); color: #fff; }
.badge-family { background: var(--green); color: #fff; opacity: .6; }

/* Filter pills */
.pills { display: flex; gap: 6px; margin-bottom: 12px; }
.pill {
  padding: 6px 14px; border-radius: 20px; font-size: 12px;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--muted); cursor: pointer; transition: all .2s;
  -webkit-tap-highlight-color: transparent;
}
.pill:checked, .pill.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.pill input { display: none; }

/* Calendar item */
.cal-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 0;
  border-bottom: 1px solid var(--border); min-height: 48px;
}
.cal-date {
  min-width: 44px; text-align: center; line-height: 1.2; flex-shrink: 0;
}
.cal-date .day { font-size: 20px; font-weight: 700; display: block; }
.cal-date .mon { font-size: 10px; color: var(--muted); text-transform: uppercase; }
.cal-title { flex: 1; font-size: 14px; }

/* Animations */
@keyframes fadeIn {
  from { opacity:0; transform:translateY(8px); }
  to { opacity:1; transform:translateY(0); }
}
@keyframes slideUp {
  from { opacity:0; transform:translateY(20px); }
  to { opacity:1; transform:translateY(0); }
}
.app-shell { animation: slideUp .35s ease; }

/* Login */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 30% 20%, rgba(124,92,252,.15) 0%, transparent 60%),
              radial-gradient(ellipse at 70% 80%, rgba(59,130,246,.1) 0%, transparent 60%);
  padding: 24px;
}
.login-card { width: 100%; max-width: 360px; }
.login-card h1 { text-align: center; margin-bottom: 24px; font-size: 22px; }
.login-card .error { color: var(--red); font-size: 13px; text-align: center; margin-bottom: 12px; }
.login-card .toggle { text-align: center; margin-top: 16px; font-size: 13px; color: var(--muted); }

/* Note card */
.note-card { margin-bottom: 10px; }
.note-card .note-title { font-weight: 600; margin-bottom: 4px; }
.note-card .note-body { color: var(--muted); font-size: 13px; line-height: 1.4; }

/* Scrollbar */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* Hide scroll on nav pages */
.hide-scroll { overflow: hidden; }
