*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", sans-serif; font-size: 16px; -webkit-font-smoothing: antialiased; }
body { background: #FAF8F5; color: #2C2C2C; display: flex; justify-content: center; min-height: 100vh; }
.phone-frame { width: 390px; min-height: 100vh; background: #FAF8F5; position: relative; display: flex; flex-direction: column; }
@media (max-width: 420px) { .phone-frame { width: 100%; } }
.status-bar { display: flex; justify-content: space-between; padding: 14px 24px 6px; font-size: 13px; font-weight: 600; color: #2C2C2C; background: #FAF8F5; }
.screen-header { padding: 4px 24px 14px; display: flex; align-items: center; justify-content: space-between; background: #FAF8F5; }
.screen-header h1 { font-size: 28px; font-weight: 800; letter-spacing: -0.8px; color: #2C2C2C; }
.screen-header h1 .sub { font-weight: 600; color: #B0ABA0; font-size: 26px; }
.header-btn { background: none; border: none; font-size: 16px; font-weight: 600; color: #2D6A4F; cursor: pointer; font-family: inherit; padding: 6px 12px; border-radius: 10px; }
.header-btn:hover { background: rgba(45,106,79,0.06); }
.content { flex: 1; overflow-y: auto; padding: 0 20px 90px; }

/* Cards */
.card { background: #fff; border-radius: 18px; padding: 18px 20px; margin-bottom: 14px; box-shadow: 0 2px 12px rgba(0,0,0,0.04), 0 0 0 1px rgba(0,0,0,0.02); position: relative; overflow: hidden; cursor: pointer; transition: transform 0.15s; }
.card:active { transform: scale(0.98); }
.card-bar { position: absolute; left: 0; top: 10px; bottom: 10px; width: 4px; border-radius: 0 3px 3px 0; }
.card-bar.skincare { background: #E8A0B4; }
.card-bar.supplements { background: #2D6A4F; }
.card-bar.jewelry { background: #D4A853; }
.card-bar.other { background: #B0ABA0; }

.card-top { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 4px; }
.card-title { font-size: 16px; font-weight: 700; color: #2C2C2C; letter-spacing: -0.3px; }
.card-title .brand { font-weight: 400; color: #B0ABA0; font-size: 14px; }
.card-right { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.card-qty { font-size: 14px; font-weight: 600; color: #2C2C2C; }
.card-arrow { font-size: 10px; color: #C0BAB0; }
.card-bottom { display: flex; align-items: center; justify-content: space-between; margin-top: 2px; }
.card-meta { font-size: 13px; color: #B0ABA0; }
.card-expiry { font-size: 13px; font-weight: 600; }
.card-expiry.urgent { color: #E07A5F; }
.card-expiry.soon { color: #D4A853; }
.card-expiry.safe { color: #2D6A4F; }

/* Section headers */
.section-header { display: flex; justify-content: space-between; align-items: center; margin: 22px 0 12px; }
.section-header h2 { font-size: 15px; font-weight: 700; color: #2C2C2C; letter-spacing: -0.2px; }
.section-header a { font-size: 13px; color: #2D6A4F; font-weight: 600; text-decoration: none; cursor: pointer; }

/* Stats */
.stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 20px; }
.stat-card { background: #fff; border-radius: 16px; padding: 16px 8px; text-align: center; box-shadow: 0 2px 8px rgba(0,0,0,0.03); }
.stat-num { font-size: 26px; font-weight: 800; letter-spacing: -0.5px; }
.stat-num.pink { color: #E8A0B4; }
.stat-num.green { color: #2D6A4F; }
.stat-num.gold { color: #D4A853; }
.stat-label { font-size: 12px; color: #B0ABA0; margin-top: 4px; font-weight: 500; }

/* Tab bar */
.tab-bar { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 390px; background: rgba(255,255,255,0.95); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); border-top: 0.5px solid rgba(0,0,0,0.04); display: flex; padding: 4px 0 18px; z-index: 60; }
@media (max-width: 420px) { .tab-bar { width: 100%; } }
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px; cursor: pointer; border: none; background: none; font-family: inherit; color: #C0BAB0; font-size: 16px; transition: color 0.15s; padding: 6px 0; }
.tab.active { color: #2D6A4F; }
.tab-icon { font-size: 22px; line-height: 1; }
.tab-label { font-size: 10px; font-weight: 600; letter-spacing: 0.2px; }

/* FAB */
.fab { position: fixed; bottom: 84px; right: calc(50% - 179px); width: 54px; height: 54px; border-radius: 50%; background: #2D6A4F; color: #fff; border: none; font-size: 30px; font-weight: 300; box-shadow: 0 4px 16px rgba(45,106,79,0.3); cursor: pointer; display: flex; align-items: center; justify-content: center; z-index: 50; }
.fab:active { transform: scale(0.92); }
@media (max-width: 420px) { .fab { right: 24px; } }

/* Screens */
.screen { display: none; }
.screen.active { display: block; }

/* Modal */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.3); z-index: 100; justify-content: flex-end; align-items: flex-end; }
.modal-overlay.active { display: flex; }
.modal-sheet { background: #fff; border-radius: 24px 24px 0 0; width: 100%; max-height: 85vh; overflow-y: auto; padding: 20px 24px 32px; animation: slideUp 0.3s ease; }
@keyframes slideUp { from { transform: translateY(100%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-handle { width: 40px; height: 4px; border-radius: 2px; background: #E0DDD8; margin: 0 auto 20px; }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.modal-header h2 { font-size: 19px; font-weight: 700; letter-spacing: -0.3px; }
.modal-close { font-size: 22px; color: #C0BAB0; cursor: pointer; border: none; background: none; font-family: inherit; padding: 4px; line-height: 1; }
.modal-actions { display: flex; gap: 10px; margin-top: 24px; }
.modal-actions .btn { flex: 1; padding: 14px; border-radius: 14px; border: none; font-size: 15px; font-weight: 600; cursor: pointer; font-family: inherit; }
.btn-primary { background: #2D6A4F; color: #fff; }
.btn-outline { background: none; color: #2C2C2C; border: 1.5px solid #D4D0CA; }

/* Form */
.form-group { margin-bottom: 18px; }
.form-group label { font-size: 13px; font-weight: 600; color: #B0ABA0; display: block; margin-bottom: 6px; letter-spacing: 0.3px; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 14px 16px; border: 1.5px solid #EDEAE4; border-radius: 14px; font-size: 16px; font-family: inherit; background: #FAF8F5; color: #2C2C2C; outline: none; }
.form-group input:focus, .form-group select:focus { border-color: #2D6A4F; background: #fff; }
.form-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* Empty state */
.empty-state { text-align: center; padding: 60px 20px; color: #B0ABA0; }
.empty-state .icon { font-size: 48px; margin-bottom: 12px; }
.empty-state p { font-size: 14px; line-height: 1.5; }

/* Quick add grid */
.quick-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 20px; }
.quick-item { background: #fff; border-radius: 16px; padding: 16px 8px; text-align: center; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,0.03); }
.quick-item:active { transform: scale(0.96); }
.quick-item .qi-icon { font-size: 26px; margin-bottom: 6px; }
.quick-item .qi-label { font-size: 12px; font-weight: 600; color: #2D6A4F; }

/* Expiry tag */
.expiry-tag { display: inline-block; padding: 3px 10px; border-radius: 10px; font-size: 11px; font-weight: 700; }
.expiry-tag.urgent { background: #FDF1E7; color: #E07A5F; }
.expiry-tag.soon { background: #FDF6E3; color: #D4A853; }
.expiry-tag.safe { background: #EDF5F0; color: #2D6A4F; }
.expiry-tag.expired { background: #FFEBEE; color: #C62828; }

.detail-row { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 0.5px solid #F0EDE8; font-size: 15px; }
.detail-row .label { color: #B0ABA0; }
.detail-row .value { font-weight: 600; text-align: right; max-width: 60%; }

.loading { text-align: center; padding: 40px; color: #B0ABA0; }
.loading .spinner { display: inline-block; width: 24px; height: 24px; border: 3px solid #EDEAE4; border-top-color: #2D6A4F; border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
