:root {
  --bg-main: #0f172a;
  --bg-card: #1e293b;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --primary: #3b82f6;
  --success: #22c55e;
  --border: #334155;
  --safe-bottom: env(safe-area-inset-bottom, 20px);
}

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

body { background: var(--bg-main); color: var(--text-main); font-family: system-ui, sans-serif; display: flex; flex-direction: column; height: 100vh; height: 100dvh; overflow: hidden; }
#app-container { display: flex; flex-direction: column; height: 100%; width: 100%; }

/* Header & Progress */
.app-header { background: var(--bg-card); padding: 20px 20px 16px; border-bottom: 1px solid var(--border); z-index: 10; }
.header-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.header-top h1 { font-size: 1.5rem; font-weight: 700; margin: 0; }
.icon-btn { background: var(--primary); border: none; border-radius: 50%; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; cursor: pointer; box-shadow: 0 4px 10px rgba(59, 130, 246, 0.3); }
.progress-container { width: 100%; }
.progress-text { display: flex; justify-content: space-between; font-size: 0.85rem; color: var(--text-muted); margin-bottom: 8px; font-weight: 500; }
.progress-bar-bg { width: 100%; height: 6px; background: var(--border); border-radius: 10px; overflow: hidden; }
.progress-bar-fill { height: 100%; background: var(--success); width: 0%; transition: width 0.4s ease; }

/* Main Content & Cards */
.scrollable-content { flex: 1; overflow-y: auto; padding: 16px; padding-bottom: 80px; }
.category-section { margin-bottom: 24px; }
.category-header { font-size: 1.1rem; color: var(--primary); font-weight: 600; margin-bottom: 12px; padding-right: 4px; display: flex; justify-content: space-between; align-items: center; cursor: pointer; }
.list-item { background: var(--bg-card); border-radius: 12px; padding: 16px; margin-bottom: 8px; display: flex; justify-content: space-between; align-items: center; box-shadow: 0 2px 8px rgba(0,0,0,0.2); border: 1px solid rgba(255,255,255,0.02); }
.item-info { display: flex; align-items: center; gap: 16px; }
.item-icon { font-size: 1.8rem; background: rgba(255,255,255,0.05); padding: 8px; border-radius: 10px; }
.item-name { font-size: 1.15rem; font-weight: 500; }
.quantity-controls { display: flex; align-items: center; background: var(--bg-main); border-radius: 8px; padding: 4px; border: 1px solid var(--border); direction: ltr; }
.btn-qty { background: transparent; border: none; color: var(--text-main); font-size: 1.2rem; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.qty-count { font-size: 1.1rem; font-weight: bold; width: 28px; text-align: center; }

/* Accordion Specifics */
.chevron { transition: transform 0.3s ease; }
.chevron.rotate { transform: rotate(180deg); }
.category-content { overflow: hidden; transition: max-height 0.3s ease; padding: 0 4px; }
.category-content.hidden { display: none; }

/* Bottom Nav */
.bottom-nav { position: fixed; bottom: 0; width: 100%; background: var(--bg-card); display: flex; justify-content: space-around; padding: 12px 0 var(--safe-bottom); border-top: 1px solid var(--border); z-index: 20; }
.nav-item { background: none; border: none; color: var(--text-muted); font-size: 0.8rem; display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; }
.nav-item.active { color: var(--primary); }

/* Modal */
.modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); backdrop-filter: blur(4px); display: flex; justify-content: center; align-items: center; z-index: 100; }
.modal.hidden { display: none; }
.modal-content { width: 90%; max-width: 400px; display: flex; flex-direction: column; gap: 16px; background: var(--bg-card); padding: 24px; border-radius: 16px; border: 1px solid var(--border); box-shadow: 0 10px 25px rgba(0,0,0,0.5); }
.modal-content input, .modal-content select { width: 100%; padding: 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg-main); color: var(--text-main); font-size: 1rem; }
.modal-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 8px; }
.btn-secondary { background: transparent; border: 1px solid var(--border); color: var(--text-main); padding: 10px 20px; border-radius: 8px; cursor: pointer; }
.btn-primary { background: var(--primary); color: #ffffff; border: none; padding: 10px 20px; border-radius: 8px; font-weight: bold; cursor: pointer; }
