* { box-sizing: border-box; }
:root {
  --bg: #0c0f14; --surface: #11151d; --muted-bg: #0d121a; --text: #e9eef6; --muted: #9ab0cc; --accent: #6aa6ff; --accent-2: #24d8a7; --border: #1a2334;
  --radius: 12px; --shadow: 0 6px 24px rgba(0,0,0,.35);
}
html, body { margin: 0; height: 100%; }
body { font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; background: linear-gradient(180deg, var(--bg), #0a0e15 60%); color: var(--text); }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; position: sticky; top: 0; background: rgba(12,15,20,.6); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
main { padding: 14px; max-width: 900px; margin: 0 auto 80px; }
#app-section { margin-bottom: 100px; }
.card { padding: 14px; margin: 14px 0; }
h1,h2,h3 { margin: 8px 0 10px; font-weight: 650; letter-spacing: .2px; }
.muted { color: var(--muted); }
.text { background: transparent; color: var(--text); border: none; padding: 8px 10px; }

input, button, select { padding: 12px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--muted-bg); color: var(--text); }
button { background: var(--accent); color: #07111f; font-weight: 650; border: none; }
button:hover { filter: brightness(1.06); }
.button-inline { width: auto; }
.btn-sm { padding: 8px 10px; border-radius: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; background: #0e1623; border: 1px solid var(--border); color: var(--muted); margin: 6px; }
.hidden { display: none; }
.list { list-style: none; padding: 0; margin: 0; }
.list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--border); position: relative; }
.row { display: flex; gap: 10px; }
.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.center { align-items: center; }

/* Bottom nav */
.bottom-nav { position: fixed; bottom: 10px; left: 50%; transform: translateX(-50%); width: min(100% - 20px, 820px); background: rgba(16,22,32,.85); backdrop-filter: blur(12px); border: 1px solid var(--border); border-radius: 999px; padding: 8px; display: flex; align-items: center; justify-content: space-between; gap: 8px; box-shadow: var(--shadow); }
.pill-row { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.pill { white-space: nowrap; padding: 8px 12px; border-radius: 999px; background: #0e1623; border: 1px solid var(--border); color: var(--text); }
.pill.active { background: var(--accent); color: #07111f; border-color: transparent; }

/* Manage panel */
.panel { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: grid; place-items: end center; }
.panel .panel-content { width: min(100%, 860px); background: var(--surface); border: 1px solid var(--border); border-bottom-left-radius: 0; border-bottom-right-radius: 0; border-top-left-radius: var(--radius); border-top-right-radius: var(--radius); box-shadow: var(--shadow); padding: 12px; }

/* Ensure hidden overrides component display */
.bottom-nav.hidden { display: none !important; }
.panel.hidden { display: none !important; }

/* Item actions */
.item-actions { display: inline-flex; gap: 12px; align-items: center; }
.icon-btn { width: auto; padding: 6px 8px; border-radius: 8px; background: #152033; color: var(--text); border: 1px solid var(--border); }
.icon-btn.danger { background: #2a1420; border-color: #5a1f34; margin-left: 24px; }
.icon-btn.disabled { opacity: 0.4; cursor: not-allowed; }
.icon-btn.disabled:hover { filter: none; }

footer { padding: 18px 14px; text-align: center; color: var(--muted); }

#new-item-form { width: 100%; margin-bottom: 14px; }
#new-item-form > * { flex: 1; min-width: 0; }
#new-item-form button { flex: 0 0 auto; width: auto; }
@media (min-width: 720px) { .row.wrap > * { flex: 1; } }
