:root {
    --primary: #007bff;
    --bg: #f2f2f7;
    --text: #1a1a1a;
    --border: #e5e5ea;
    --secondary-text: #8e8e93;
    --danger: #ff3b30;
    --success: #28a745;
}

body { 
    font-family: -apple-system, sans-serif; 
    margin: 0; padding-top: 60px; background: var(--bg); color: var(--text);
    overflow-x: hidden;
}

/* TOP NAV */
.action-bar {
    position: fixed; top: 0; left: 0; right: 0; height: 55px;
    background: #fff; border-bottom: 1px solid var(--border);
    display: flex; z-index: 1000;
}
.nav-btn { flex: 1; border: none; background: none; font-size: 1.4rem; color: var(--secondary-text); display: flex; align-items: center; justify-content: center; }
.nav-btn.active { color: var(--primary); border-bottom: 3px solid var(--primary); }
.plus-btn { color: var(--primary); font-size: 2.2rem; }

/* MODAL */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.5);
    z-index: 2000; display: none; align-items: flex-start; padding-top: 40px;
}
.add-card { 
    width: 92%; margin: 0 auto; background: white; border-radius: 15px; 
    padding: 20px; box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    position: relative; box-sizing: border-box;
}

/* DROPDOWNS & LAYERING */
.dropdown-wrapper { 
    position: relative; 
    z-index: 1; /* Default low z-index */
}
.custom-dropdown { 
    display: none; position: absolute; width: 100%; 
    max-height: 180px; overflow-y: auto; background: #fff; 
    border: 1px solid var(--border); border-radius: 8px; 
    box-shadow: 0 8px 16px rgba(0,0,0,0.2); 
    z-index: 100; /* High within the wrapper */
}
.dropdown-item { padding: 12px; border-bottom: 1px solid #f0f0f0; font-size: 0.9rem; }

/* SWIPE TO DELETE */
.swipe-container { position: relative; overflow: hidden; margin-bottom: 10px; border-radius: 12px; background: var(--danger); }
.swipe-delete-bg { position: absolute; right: 0; top: 0; bottom: 0; width: 85px; display: flex; align-items: center; justify-content: center; }
.delete-btn-inner { background: none; border: none; color: white; font-weight: bold; width: 100%; height: 100%; }
.swipe-content { position: relative; background: white; z-index: 2; transition: transform 0.3s ease; display: flex; align-items: center; padding: 15px; gap: 12px; }

/* FORM ELEMENTS */
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.close-btn { background: #eee; border: none; border-radius: 50%; width: 30px; height: 30px; }
.form-group { display: flex; flex-direction: column; gap: 12px; }
.input-field { width: 100%; padding: 15px; border: 1px solid var(--border); border-radius: 10px; font-size: 1.1rem; box-sizing: border-box; }
.input-field-sm { width: 100%; padding: 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 0.95rem; box-sizing: border-box; }
.btn-submit { background: var(--success); color: white; border: none; padding: 15px; border-radius: 10px; font-weight: 700; }

/* LIST INTERNALS */
.container { padding: 12px; max-width: 600px; margin: 0 auto; }
.view-title { color: var(--secondary-text); font-size: 0.85rem; text-transform: uppercase; margin: 15px 5px 8px; }
.item-content { flex-grow: 1; }
.item-text { font-weight: 600; display: block; font-size: 1rem; }
.badge { display: inline-block; background: #e7f3ff; color: var(--primary); font-size: 0.75rem; padding: 2px 8px; border-radius: 4px; margin-top: 4px; }
.tag { color: var(--secondary-text); font-size: 0.8rem; margin-right: 5px; }
.edit-link { font-size: 0.85rem; color: var(--primary); text-decoration: none; }
.filter-bar { margin-bottom: 12px; }
#assigned-search { width: 100%; padding: 10px; border-radius: 10px; border: 1px solid var(--border); box-sizing: border-box; }